<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE ViewPatterns #-}</span><span>
</span><span id="line-2"></span><span>
</span><span id="line-3"></span><span class="hs-comment">{-

This module contains code which maintains and manipulates the
fixity environment during renaming.

-}</span><span>
</span><span id="line-9"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Rename.Fixity</span><span>
</span><span id="line-10"></span><span>   </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Rename.Fixity.html#MiniFixityEnv"><span class="hs-identifier">MiniFixityEnv</span></a></span><span>
</span><span id="line-11"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Fixity.html#addLocalFixities"><span class="hs-identifier">addLocalFixities</span></a></span><span>
</span><span id="line-12"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Fixity.html#lookupFixityRn"><span class="hs-identifier">lookupFixityRn</span></a></span><span>
</span><span id="line-13"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Fixity.html#lookupFixityRn_help"><span class="hs-identifier">lookupFixityRn_help</span></a></span><span>
</span><span id="line-14"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Fixity.html#lookupFieldFixityRn"><span class="hs-identifier">lookupFieldFixityRn</span></a></span><span>
</span><span id="line-15"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Fixity.html#lookupTyFixityRn"><span class="hs-identifier">lookupTyFixityRn</span></a></span><span>
</span><span id="line-16"></span><span>   </span><span class="hs-special">)</span><span>
</span><span id="line-17"></span><span class="hs-keyword">where</span><span>
</span><span id="line-18"></span><span>
</span><span id="line-19"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-20"></span><span>
</span><span id="line-21"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Iface.Load.html"><span class="hs-identifier">GHC.Iface.Load</span></a></span><span>
</span><span id="line-22"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Hs.html"><span class="hs-identifier">GHC.Hs</span></a></span><span>
</span><span id="line-23"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html"><span class="hs-identifier">GHC.Types.Name.Reader</span></a></span><span>
</span><span id="line-24"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html"><span class="hs-identifier">GHC.Driver.Types</span></a></span><span>
</span><span id="line-25"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Monad.html"><span class="hs-identifier">GHC.Tc.Utils.Monad</span></a></span><span>
</span><span id="line-26"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.html"><span class="hs-identifier">GHC.Types.Name</span></a></span><span>
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.Env.html"><span class="hs-identifier">GHC.Types.Name.Env</span></a></span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Unit.Module.html"><span class="hs-identifier">GHC.Unit.Module</span></a></span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html"><span class="hs-identifier">GHC.Types.Basic</span></a></span><span>  </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#Fixity"><span class="hs-identifier">Fixity</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#FixityDirection"><span class="hs-identifier">FixityDirection</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#minPrecedence"><span class="hs-identifier">minPrecedence</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-30"></span><span>                          </span><span class="annot"><a href="GHC.Types.Basic.html#defaultFixity"><span class="hs-identifier">defaultFixity</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#SourceText"><span class="hs-identifier">SourceText</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html"><span class="hs-identifier">GHC.Types.SrcLoc</span></a></span><span>
</span><span id="line-32"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-33"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.Maybe.html"><span class="hs-identifier">GHC.Data.Maybe</span></a></span><span>
</span><span id="line-34"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.List.html#"><span class="hs-identifier">Data.List</span></a></span><span>
</span><span id="line-35"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Function.html#"><span class="hs-identifier">Data.Function</span></a></span><span>    </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Data.Function.html#on"><span class="hs-identifier">on</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-36"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Rename.Unbound.html"><span class="hs-identifier">GHC.Rename.Unbound</span></a></span><span>
</span><span id="line-37"></span><span>
</span><span id="line-38"></span><span class="hs-comment">{-
*********************************************************
*                                                      *
                Fixities
*                                                      *
*********************************************************

Note [Fixity signature lookup]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A fixity declaration like

    infixr 2 ?

can refer to a value-level operator, e.g.:

    (?) :: String -&gt; String -&gt; String

or a type-level operator, like:

    data (?) a b = A a | B b

so we extend the lookup of the reader name '?' to the TcClsName namespace, as
well as the original namespace.

The extended lookup is also used in other places, like resolution of
deprecation declarations, and lookup of names in GHCi.
-}</span><span>
</span><span id="line-65"></span><span>
</span><span id="line-66"></span><span class="hs-comment">--------------------------------</span><span>
</span><span id="line-67"></span><span class="hs-keyword">type</span><span> </span><span id="MiniFixityEnv"><span class="annot"><a href="GHC.Rename.Fixity.html#MiniFixityEnv"><span class="hs-identifier hs-var">MiniFixityEnv</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Data.FastString.Env.html#FastStringEnv"><span class="hs-identifier hs-type">FastStringEnv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#Fixity"><span class="hs-identifier hs-type">Fixity</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-68"></span><span>        </span><span class="hs-comment">-- Mini fixity env for the names we're about</span><span>
</span><span id="line-69"></span><span>        </span><span class="hs-comment">-- to bind, in a single binding group</span><span>
</span><span id="line-70"></span><span>        </span><span class="hs-comment">--</span><span>
</span><span id="line-71"></span><span>        </span><span class="hs-comment">-- It is keyed by the *FastString*, not the *OccName*, because</span><span>
</span><span id="line-72"></span><span>        </span><span class="hs-comment">-- the single fixity decl       infix 3 T</span><span>
</span><span id="line-73"></span><span>        </span><span class="hs-comment">-- affects both the data constructor T and the type constructor T</span><span>
</span><span id="line-74"></span><span>        </span><span class="hs-comment">--</span><span>
</span><span id="line-75"></span><span>        </span><span class="hs-comment">-- We keep the location so that if we find</span><span>
</span><span id="line-76"></span><span>        </span><span class="hs-comment">-- a duplicate, we can report it sensibly</span><span>
</span><span id="line-77"></span><span>
</span><span id="line-78"></span><span class="hs-comment">--------------------------------</span><span>
</span><span id="line-79"></span><span class="hs-comment">-- Used for nested fixity decls to bind names along with their fixities.</span><span>
</span><span id="line-80"></span><span class="hs-comment">-- the fixities are given as a UFM from an OccName's FastString to a fixity decl</span><span>
</span><span id="line-81"></span><span>
</span><span id="line-82"></span><span id="local-6989586621681130959"><span class="annot"><a href="GHC.Rename.Fixity.html#addLocalFixities"><span class="hs-identifier hs-type">addLocalFixities</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Rename.Fixity.html#MiniFixityEnv"><span class="hs-identifier hs-type">MiniFixityEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681130959"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681130959"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-83"></span><span id="addLocalFixities"><span class="annot"><span class="annottext">addLocalFixities :: forall a. MiniFixityEnv -&gt; [Name] -&gt; RnM a -&gt; RnM a
</span><a href="GHC.Rename.Fixity.html#addLocalFixities"><span class="hs-identifier hs-var hs-var">addLocalFixities</span></a></span></span><span> </span><span id="local-6989586621681130839"><span class="annot"><span class="annottext">MiniFixityEnv
</span><a href="#local-6989586621681130839"><span class="hs-identifier hs-var">mini_fix_env</span></a></span></span><span> </span><span id="local-6989586621681130838"><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681130838"><span class="hs-identifier hs-var">names</span></a></span></span><span> </span><span id="local-6989586621681130837"><span class="annot"><span class="annottext">RnM a
</span><a href="#local-6989586621681130837"><span class="hs-identifier hs-var">thing_inside</span></a></span></span><span>
</span><span id="line-84"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Name, FixItem)] -&gt; RnM a -&gt; RnM a
forall a. [(Name, FixItem)] -&gt; RnM a -&gt; RnM a
</span><a href="GHC.Tc.Utils.Monad.html#extendFixityEnv"><span class="hs-identifier hs-var">extendFixityEnv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Name -&gt; Maybe (Name, FixItem)) -&gt; [Name] -&gt; [(Name, FixItem)]
forall a b. (a -&gt; Maybe b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/Data.Maybe.html#mapMaybe"><span class="hs-identifier hs-var">mapMaybe</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; Maybe (Name, FixItem)
</span><a href="#local-6989586621681130834"><span class="hs-identifier hs-var">find_fixity</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681130838"><span class="hs-identifier hs-var">names</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">RnM a
</span><a href="#local-6989586621681130837"><span class="hs-identifier hs-var">thing_inside</span></a></span><span>
</span><span id="line-85"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-86"></span><span>    </span><span id="local-6989586621681130834"><span class="annot"><span class="annottext">find_fixity :: Name -&gt; Maybe (Name, FixItem)
</span><a href="#local-6989586621681130834"><span class="hs-identifier hs-var hs-var">find_fixity</span></a></span></span><span> </span><span id="local-6989586621681130833"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681130833"><span class="hs-identifier hs-var">name</span></a></span></span><span>
</span><span id="line-87"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">MiniFixityEnv -&gt; FastString -&gt; Maybe (Located Fixity)
forall a. FastStringEnv a -&gt; FastString -&gt; Maybe a
</span><a href="GHC.Data.FastString.Env.html#lookupFsEnv"><span class="hs-identifier hs-var">lookupFsEnv</span></a></span><span> </span><span class="annot"><span class="annottext">MiniFixityEnv
</span><a href="#local-6989586621681130839"><span class="hs-identifier hs-var">mini_fix_env</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OccName -&gt; FastString
</span><a href="GHC.Types.Name.Occurrence.html#occNameFS"><span class="hs-identifier hs-var hs-var">occNameFS</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681130830"><span class="hs-identifier hs-var">occ</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-88"></span><span>          </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681130829"><span class="annot"><span class="annottext">Located Fixity
</span><a href="#local-6989586621681130829"><span class="hs-identifier hs-var">lfix</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(Name, FixItem) -&gt; Maybe (Name, FixItem)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681130833"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">OccName -&gt; Fixity -&gt; FixItem
</span><a href="GHC.Driver.Types.html#FixItem"><span class="hs-identifier hs-var">FixItem</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681130830"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located Fixity -&gt; Fixity
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">Located Fixity
</span><a href="#local-6989586621681130829"><span class="hs-identifier hs-var">lfix</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-89"></span><span>          </span><span class="annot"><span class="annottext">Maybe (Located Fixity)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe (Name, FixItem)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-90"></span><span>      </span><span class="hs-keyword">where</span><span>
</span><span id="line-91"></span><span>        </span><span id="local-6989586621681130830"><span class="annot"><span class="annottext">occ :: OccName
</span><a href="#local-6989586621681130830"><span class="hs-identifier hs-var hs-var">occ</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; OccName
</span><a href="GHC.Types.Name.html#nameOccName"><span class="hs-identifier hs-var">nameOccName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681130833"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-92"></span><span>
</span><span id="line-93"></span><span class="hs-comment">{-
--------------------------------
lookupFixity is a bit strange.

* Nested local fixity decls are put in the local fixity env, which we
  find with getFixtyEnv

* Imported fixities are found in the PIT

* Top-level fixity decls in this module may be for Names that are
    either  Global         (constructors, class operations)
    or      Local/Exported (everything else)
  (See notes with GHC.Rename.Names.getLocalDeclBinders for why we have this split.)
  We put them all in the local fixity environment
-}</span><span>
</span><span id="line-108"></span><span>
</span><span id="line-109"></span><span class="annot"><a href="GHC.Rename.Fixity.html#lookupFixityRn"><span class="hs-identifier hs-type">lookupFixityRn</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#Fixity"><span class="hs-identifier hs-type">Fixity</span></a></span><span>
</span><span id="line-110"></span><span id="lookupFixityRn"><span class="annot"><span class="annottext">lookupFixityRn :: Name -&gt; RnM Fixity
</span><a href="GHC.Rename.Fixity.html#lookupFixityRn"><span class="hs-identifier hs-var hs-var">lookupFixityRn</span></a></span></span><span> </span><span id="local-6989586621681130825"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681130825"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; OccName -&gt; RnM Fixity
</span><a href="GHC.Rename.Fixity.html#lookupFixityRn%27"><span class="hs-identifier hs-var">lookupFixityRn'</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681130825"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; OccName
</span><a href="GHC.Types.Name.html#nameOccName"><span class="hs-identifier hs-var">nameOccName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681130825"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-111"></span><span>
</span><span id="line-112"></span><span class="annot"><a href="GHC.Rename.Fixity.html#lookupFixityRn%27"><span class="hs-identifier hs-type">lookupFixityRn'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Occurrence.html#OccName"><span class="hs-identifier hs-type">OccName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#Fixity"><span class="hs-identifier hs-type">Fixity</span></a></span><span>
</span><span id="line-113"></span><span id="lookupFixityRn%27"><span class="annot"><span class="annottext">lookupFixityRn' :: Name -&gt; OccName -&gt; RnM Fixity
</span><a href="GHC.Rename.Fixity.html#lookupFixityRn%27"><span class="hs-identifier hs-var hs-var">lookupFixityRn'</span></a></span></span><span> </span><span id="local-6989586621681130823"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681130823"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((Bool, Fixity) -&gt; Fixity)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Bool, Fixity) -&gt; RnM Fixity
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">(Bool, Fixity) -&gt; Fixity
forall a b. (a, b) -&gt; b
</span><a href="../../base/src/Data.Tuple.html#snd"><span class="hs-identifier hs-var">snd</span></a></span><span> </span><span class="annot"><span class="annottext">(IOEnv (Env TcGblEnv TcLclEnv) (Bool, Fixity) -&gt; RnM Fixity)
-&gt; (OccName -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Bool, Fixity))
-&gt; OccName
-&gt; RnM Fixity
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; OccName -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Bool, Fixity)
</span><a href="GHC.Rename.Fixity.html#lookupFixityRn_help%27"><span class="hs-identifier hs-var">lookupFixityRn_help'</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681130823"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-114"></span><span>
</span><span id="line-115"></span><span class="hs-comment">-- | 'lookupFixityRn_help' returns @(True, fixity)@ if it finds a 'Fixity'</span><span>
</span><span id="line-116"></span><span class="hs-comment">-- in a local environment or from an interface file. Otherwise, it returns</span><span>
</span><span id="line-117"></span><span class="hs-comment">-- @(False, fixity)@ (e.g., for unbound 'Name's or 'Name's without</span><span>
</span><span id="line-118"></span><span class="hs-comment">-- user-supplied fixity declarations).</span><span>
</span><span id="line-119"></span><span class="annot"><a href="GHC.Rename.Fixity.html#lookupFixityRn_help"><span class="hs-identifier hs-type">lookupFixityRn_help</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>
</span><span id="line-120"></span><span>                    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#Fixity"><span class="hs-identifier hs-type">Fixity</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-121"></span><span id="lookupFixityRn_help"><span class="annot"><span class="annottext">lookupFixityRn_help :: Name -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Bool, Fixity)
</span><a href="GHC.Rename.Fixity.html#lookupFixityRn_help"><span class="hs-identifier hs-var hs-var">lookupFixityRn_help</span></a></span></span><span> </span><span id="local-6989586621681130820"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681130820"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-122"></span><span>    </span><span class="annot"><span class="annottext">Name -&gt; OccName -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Bool, Fixity)
</span><a href="GHC.Rename.Fixity.html#lookupFixityRn_help%27"><span class="hs-identifier hs-var">lookupFixityRn_help'</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681130820"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; OccName
</span><a href="GHC.Types.Name.html#nameOccName"><span class="hs-identifier hs-var">nameOccName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681130820"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-123"></span><span>
</span><span id="line-124"></span><span class="annot"><a href="GHC.Rename.Fixity.html#lookupFixityRn_help%27"><span class="hs-identifier hs-type">lookupFixityRn_help'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>
</span><span id="line-125"></span><span>                     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Occurrence.html#OccName"><span class="hs-identifier hs-type">OccName</span></a></span><span>
</span><span id="line-126"></span><span>                     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#Fixity"><span class="hs-identifier hs-type">Fixity</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-127"></span><span id="lookupFixityRn_help%27"><span class="annot"><span class="annottext">lookupFixityRn_help' :: Name -&gt; OccName -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Bool, Fixity)
</span><a href="GHC.Rename.Fixity.html#lookupFixityRn_help%27"><span class="hs-identifier hs-var hs-var">lookupFixityRn_help'</span></a></span></span><span> </span><span id="local-6989586621681130819"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681130819"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621681130818"><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681130818"><span class="hs-identifier hs-var">occ</span></a></span></span><span>
</span><span id="line-128"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Bool
</span><a href="GHC.Builtin.Names.html#isUnboundName"><span class="hs-identifier hs-var">isUnboundName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681130819"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-129"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Bool, Fixity) -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Bool, Fixity)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SourceText -&gt; Int -&gt; FixityDirection -&gt; Fixity
</span><a href="GHC.Types.Basic.html#Fixity"><span class="hs-identifier hs-var">Fixity</span></a></span><span> </span><span class="annot"><span class="annottext">SourceText
</span><a href="GHC.Types.Basic.html#NoSourceText"><span class="hs-identifier hs-var">NoSourceText</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="GHC.Types.Basic.html#minPrecedence"><span class="hs-identifier hs-var">minPrecedence</span></a></span><span> </span><span class="annot"><span class="annottext">FixityDirection
</span><a href="GHC.Types.Basic.html#InfixL"><span class="hs-identifier hs-var">InfixL</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-130"></span><span>    </span><span class="hs-comment">-- Minimise errors from ubound names; eg</span><span>
</span><span id="line-131"></span><span>    </span><span class="hs-comment">--    a&gt;0 `foo` b&gt;0</span><span>
</span><span id="line-132"></span><span>    </span><span class="hs-comment">-- where 'foo' is not in scope, should not give an error (#7937)</span><span>
</span><span id="line-133"></span><span>
</span><span id="line-134"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-135"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681130813"><span class="annot"><span class="annottext">FixityEnv
</span><a href="#local-6989586621681130813"><span class="hs-identifier hs-var">local_fix_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRn FixityEnv
</span><a href="GHC.Tc.Utils.Monad.html#getFixityEnv"><span class="hs-identifier hs-var">getFixityEnv</span></a></span><span>
</span><span id="line-136"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">FixityEnv -&gt; Name -&gt; Maybe FixItem
forall a. NameEnv a -&gt; Name -&gt; Maybe a
</span><a href="GHC.Types.Name.Env.html#lookupNameEnv"><span class="hs-identifier hs-var">lookupNameEnv</span></a></span><span> </span><span class="annot"><span class="annottext">FixityEnv
</span><a href="#local-6989586621681130813"><span class="hs-identifier hs-var">local_fix_env</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681130819"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-137"></span><span>           </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Types.html#FixItem"><span class="hs-identifier hs-type">FixItem</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681130810"><span class="annot"><span class="annottext">Fixity
</span><a href="#local-6989586621681130810"><span class="hs-identifier hs-var">fix</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(Bool, Fixity) -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Bool, Fixity)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Fixity
</span><a href="#local-6989586621681130810"><span class="hs-identifier hs-var">fix</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">;</span><span>
</span><span id="line-138"></span><span>           </span><span class="annot"><span class="annottext">Maybe FixItem
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-139"></span><span>
</span><span id="line-140"></span><span>    </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681130809"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681130809"><span class="hs-identifier hs-var">this_mod</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv (Env TcGblEnv TcLclEnv) Module
forall (m :: * -&gt; *). HasModule m =&gt; m Module
</span><a href="GHC.Unit.Module.html#getModule"><span class="hs-identifier hs-var">getModule</span></a></span><span>
</span><span id="line-141"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Module -&gt; Name -&gt; Bool
</span><a href="GHC.Types.Name.html#nameIsLocalOrFrom"><span class="hs-identifier hs-var">nameIsLocalOrFrom</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681130809"><span class="hs-identifier hs-var">this_mod</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681130819"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-142"></span><span>               </span><span class="hs-comment">-- Local (and interactive) names are all in the</span><span>
</span><span id="line-143"></span><span>               </span><span class="hs-comment">-- fixity env, and don't have entries in the HPT</span><span>
</span><span id="line-144"></span><span>         </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">(Bool, Fixity) -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Bool, Fixity)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Fixity
</span><a href="GHC.Types.Basic.html#defaultFixity"><span class="hs-identifier hs-var">defaultFixity</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-145"></span><span>         </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">IOEnv (Env TcGblEnv TcLclEnv) (Bool, Fixity)
</span><a href="#local-6989586621681130806"><span class="hs-identifier hs-var">lookup_imported</span></a></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-146"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-147"></span><span>    </span><span id="local-6989586621681130806"><span class="annot"><span class="annottext">lookup_imported :: IOEnv (Env TcGblEnv TcLclEnv) (Bool, Fixity)
</span><a href="#local-6989586621681130806"><span class="hs-identifier hs-var hs-var">lookup_imported</span></a></span></span><span>
</span><span id="line-148"></span><span>      </span><span class="hs-comment">-- For imported names, we have to get their fixities by doing a</span><span>
</span><span id="line-149"></span><span>      </span><span class="hs-comment">-- loadInterfaceForName, and consulting the Ifaces that comes back</span><span>
</span><span id="line-150"></span><span>      </span><span class="hs-comment">-- from that, because the interface file for the Name might not</span><span>
</span><span id="line-151"></span><span>      </span><span class="hs-comment">-- have been loaded yet.  Why not?  Suppose you import module A,</span><span>
</span><span id="line-152"></span><span>      </span><span class="hs-comment">-- which exports a function 'f', thus;</span><span>
</span><span id="line-153"></span><span>      </span><span class="hs-comment">--        module CurrentModule where</span><span>
</span><span id="line-154"></span><span>      </span><span class="hs-comment">--          import A( f )</span><span>
</span><span id="line-155"></span><span>      </span><span class="hs-comment">--        module A( f ) where</span><span>
</span><span id="line-156"></span><span>      </span><span class="hs-comment">--          import B( f )</span><span>
</span><span id="line-157"></span><span>      </span><span class="hs-comment">-- Then B isn't loaded right away (after all, it's possible that</span><span>
</span><span id="line-158"></span><span>      </span><span class="hs-comment">-- nothing from B will be used).  When we come across a use of</span><span>
</span><span id="line-159"></span><span>      </span><span class="hs-comment">-- 'f', we need to know its fixity, and it's then, and only</span><span>
</span><span id="line-160"></span><span>      </span><span class="hs-comment">-- then, that we load B.hi.  That is what's happening here.</span><span>
</span><span id="line-161"></span><span>      </span><span class="hs-comment">--</span><span>
</span><span id="line-162"></span><span>      </span><span class="hs-comment">-- loadInterfaceForName will find B.hi even if B is a hidden module,</span><span>
</span><span id="line-163"></span><span>      </span><span class="hs-comment">-- and that's what we want.</span><span>
</span><span id="line-164"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681130802"><span class="annot"><span class="annottext">ModIface
</span><a href="#local-6989586621681130802"><span class="hs-identifier hs-var">iface</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; Name -&gt; TcRn ModIface
</span><a href="GHC.Iface.Load.html#loadInterfaceForName"><span class="hs-identifier hs-var">loadInterfaceForName</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681130800"><span class="hs-identifier hs-var">doc</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681130819"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-165"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681130799"><span class="annot"><span class="annottext">mb_fix :: Maybe Fixity
</span><a href="#local-6989586621681130799"><span class="hs-identifier hs-var hs-var">mb_fix</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModIfaceBackend -&gt; OccName -&gt; Maybe Fixity
</span><a href="GHC.Driver.Types.html#mi_fix_fn"><span class="hs-identifier hs-var hs-var">mi_fix_fn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModIface -&gt; IfaceBackendExts 'ModIfaceFinal
forall (phase :: ModIfacePhase).
ModIface_ phase -&gt; IfaceBackendExts phase
</span><a href="GHC.Driver.Types.html#mi_final_exts"><span class="hs-identifier hs-var hs-var">mi_final_exts</span></a></span><span> </span><span class="annot"><span class="annottext">ModIface
</span><a href="#local-6989586621681130802"><span class="hs-identifier hs-var">iface</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681130818"><span class="hs-identifier hs-var">occ</span></a></span><span>
</span><span id="line-166"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681130792"><span class="annot"><span class="annottext">msg :: SDoc
</span><a href="#local-6989586621681130792"><span class="hs-identifier hs-var hs-var">msg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe Fixity
</span><a href="#local-6989586621681130799"><span class="hs-identifier hs-var">mb_fix</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-167"></span><span>                            </span><span class="annot"><span class="annottext">Maybe Fixity
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-168"></span><span>                                  </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;looking up name&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681130819"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-169"></span><span>                              </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;in iface, but found no fixity for it.&quot;</span></span><span>
</span><span id="line-170"></span><span>                              </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Using default fixity instead.&quot;</span></span><span>
</span><span id="line-171"></span><span>                            </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681130788"><span class="annot"><span class="annottext">Fixity
</span><a href="#local-6989586621681130788"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-172"></span><span>                                  </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;looking up name in iface and found:&quot;</span></span><span>
</span><span id="line-173"></span><span>                              </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Name -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681130819"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Fixity -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Fixity
</span><a href="#local-6989586621681130788"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-174"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#traceRn"><span class="hs-identifier hs-var">traceRn</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;lookupFixityRn_either:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681130792"><span class="hs-identifier hs-var">msg</span></a></span><span>
</span><span id="line-175"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Bool, Fixity) -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Bool, Fixity)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Bool, Fixity)
-&gt; (Fixity -&gt; (Bool, Fixity)) -&gt; Maybe Fixity -&gt; (Bool, Fixity)
forall b a. b -&gt; (a -&gt; b) -&gt; Maybe a -&gt; b
</span><a href="../../base/src/Data.Maybe.html#maybe"><span class="hs-identifier hs-var">maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Fixity
</span><a href="GHC.Types.Basic.html#defaultFixity"><span class="hs-identifier hs-var">defaultFixity</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681130784"><span class="annot"><span class="annottext">Fixity
</span><a href="#local-6989586621681130784"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Fixity
</span><a href="#local-6989586621681130784"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Maybe Fixity
</span><a href="#local-6989586621681130799"><span class="hs-identifier hs-var">mb_fix</span></a></span><span class="hs-special">)</span><span>  </span><span class="hs-special">}</span><span>
</span><span id="line-176"></span><span>
</span><span id="line-177"></span><span>    </span><span id="local-6989586621681130800"><span class="annot"><span class="annottext">doc :: SDoc
</span><a href="#local-6989586621681130800"><span class="hs-identifier hs-var hs-var">doc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Checking fixity for&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681130819"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-178"></span><span>
</span><span id="line-179"></span><span class="hs-comment">---------------</span><span>
</span><span id="line-180"></span><span class="annot"><a href="GHC.Rename.Fixity.html#lookupTyFixityRn"><span class="hs-identifier hs-type">lookupTyFixityRn</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#Fixity"><span class="hs-identifier hs-type">Fixity</span></a></span><span>
</span><span id="line-181"></span><span id="lookupTyFixityRn"><span class="annot"><span class="annottext">lookupTyFixityRn :: Located Name -&gt; RnM Fixity
</span><a href="GHC.Rename.Fixity.html#lookupTyFixityRn"><span class="hs-identifier hs-var hs-var">lookupTyFixityRn</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; RnM Fixity
</span><a href="GHC.Rename.Fixity.html#lookupFixityRn"><span class="hs-identifier hs-var">lookupFixityRn</span></a></span><span> </span><span class="annot"><span class="annottext">(Name -&gt; RnM Fixity)
-&gt; (Located Name -&gt; Name) -&gt; Located Name -&gt; RnM Fixity
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Located Name -&gt; Name
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span>
</span><span id="line-182"></span><span>
</span><span id="line-183"></span><span class="hs-comment">-- | Look up the fixity of a (possibly ambiguous) occurrence of a record field</span><span>
</span><span id="line-184"></span><span class="hs-comment">-- selector.  We use 'lookupFixityRn'' so that we can specify the 'OccName' as</span><span>
</span><span id="line-185"></span><span class="hs-comment">-- the field label, which might be different to the 'OccName' of the selector</span><span>
</span><span id="line-186"></span><span class="hs-comment">-- 'Name' if @DuplicateRecordFields@ is in use (#1173). If there are</span><span>
</span><span id="line-187"></span><span class="hs-comment">-- multiple possible selectors with different fixities, generate an error.</span><span>
</span><span id="line-188"></span><span class="annot"><a href="GHC.Rename.Fixity.html#lookupFieldFixityRn"><span class="hs-identifier hs-type">lookupFieldFixityRn</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Type.html#AmbiguousFieldOcc"><span class="hs-identifier hs-type">AmbiguousFieldOcc</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#Fixity"><span class="hs-identifier hs-type">Fixity</span></a></span><span>
</span><span id="line-189"></span><span id="lookupFieldFixityRn"><span class="annot"><span class="annottext">lookupFieldFixityRn :: AmbiguousFieldOcc GhcRn -&gt; RnM Fixity
</span><a href="GHC.Rename.Fixity.html#lookupFieldFixityRn"><span class="hs-identifier hs-var hs-var">lookupFieldFixityRn</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Type.html#Unambiguous"><span class="hs-identifier hs-type">Unambiguous</span></a></span><span> </span><span id="local-6989586621681130781"><span class="annot"><span class="annottext">XUnambiguous GhcRn
</span><a href="#local-6989586621681130781"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621681130780"><span class="annot"><span class="annottext">Located RdrName
</span><a href="#local-6989586621681130780"><span class="hs-identifier hs-var">lrdr</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-190"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; OccName -&gt; RnM Fixity
</span><a href="GHC.Rename.Fixity.html#lookupFixityRn%27"><span class="hs-identifier hs-var">lookupFixityRn'</span></a></span><span> </span><span class="annot"><span class="annottext">Name
XUnambiguous GhcRn
</span><a href="#local-6989586621681130781"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RdrName -&gt; OccName
</span><a href="GHC.Types.Name.Reader.html#rdrNameOcc"><span class="hs-identifier hs-var">rdrNameOcc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located RdrName -&gt; RdrName
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">Located RdrName
</span><a href="#local-6989586621681130780"><span class="hs-identifier hs-var">lrdr</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-191"></span><span class="annot"><a href="GHC.Rename.Fixity.html#lookupFieldFixityRn"><span class="hs-identifier hs-var">lookupFieldFixityRn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Type.html#Ambiguous"><span class="hs-identifier hs-type">Ambiguous</span></a></span><span> </span><span class="annot"><span class="annottext">XAmbiguous GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681130777"><span class="annot"><span class="annottext">Located RdrName
</span><a href="#local-6989586621681130777"><span class="hs-identifier hs-var">lrdr</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RdrName -&gt; RnM Fixity
</span><a href="#local-6989586621681130776"><span class="hs-identifier hs-var">get_ambiguous_fixity</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located RdrName -&gt; RdrName
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">Located RdrName
</span><a href="#local-6989586621681130777"><span class="hs-identifier hs-var">lrdr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-192"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-193"></span><span>    </span><span class="annot"><a href="#local-6989586621681130776"><span class="hs-identifier hs-type">get_ambiguous_fixity</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier hs-type">RdrName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#Fixity"><span class="hs-identifier hs-type">Fixity</span></a></span><span>
</span><span id="line-194"></span><span>    </span><span id="local-6989586621681130776"><span class="annot"><span class="annottext">get_ambiguous_fixity :: RdrName -&gt; RnM Fixity
</span><a href="#local-6989586621681130776"><span class="hs-identifier hs-var hs-var">get_ambiguous_fixity</span></a></span></span><span> </span><span id="local-6989586621681130775"><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681130775"><span class="hs-identifier hs-var">rdr_name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-195"></span><span>      </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#traceRn"><span class="hs-identifier hs-var">traceRn</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;get_ambiguous_fixity&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RdrName -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681130775"><span class="hs-identifier hs-var">rdr_name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-196"></span><span>      </span><span id="local-6989586621681130774"><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681130774"><span class="hs-identifier hs-var">rdr_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRn GlobalRdrEnv
</span><a href="GHC.Tc.Utils.Monad.html#getGlobalRdrEnv"><span class="hs-identifier hs-var">getGlobalRdrEnv</span></a></span><span>
</span><span id="line-197"></span><span>      </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681130772"><span class="annot"><span class="annottext">elts :: [GlobalRdrElt]
</span><a href="#local-6989586621681130772"><span class="hs-identifier hs-var hs-var">elts</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>  </span><span class="annot"><span class="annottext">RdrName -&gt; GlobalRdrEnv -&gt; [GlobalRdrElt]
</span><a href="GHC.Types.Name.Reader.html#lookupGRE_RdrName"><span class="hs-identifier hs-var">lookupGRE_RdrName</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681130775"><span class="hs-identifier hs-var">rdr_name</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681130774"><span class="hs-identifier hs-var">rdr_env</span></a></span><span>
</span><span id="line-198"></span><span>
</span><span id="line-199"></span><span>      </span><span id="local-6989586621681130770"><span class="annot"><span class="annottext">[[(GlobalRdrElt, Fixity)]]
</span><a href="#local-6989586621681130770"><span class="hs-identifier hs-var">fixities</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">((GlobalRdrElt, Fixity) -&gt; (GlobalRdrElt, Fixity) -&gt; Bool)
-&gt; [(GlobalRdrElt, Fixity)] -&gt; [[(GlobalRdrElt, Fixity)]]
forall a. (a -&gt; a -&gt; Bool) -&gt; [a] -&gt; [[a]]
</span><a href="../../base/src/Data.OldList.html#groupBy"><span class="hs-identifier hs-var">groupBy</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Fixity -&gt; Fixity -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">(==)</span></span><span> </span><span class="annot"><span class="annottext">(Fixity -&gt; Fixity -&gt; Bool)
-&gt; ((GlobalRdrElt, Fixity) -&gt; Fixity)
-&gt; (GlobalRdrElt, Fixity)
-&gt; (GlobalRdrElt, Fixity)
-&gt; Bool
forall b c a. (b -&gt; b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; a -&gt; c
</span><a href="../../base/src/Data.Function.html#on"><span class="hs-operator hs-var">`on`</span></a></span><span> </span><span class="annot"><span class="annottext">(GlobalRdrElt, Fixity) -&gt; Fixity
forall a b. (a, b) -&gt; b
</span><a href="../../base/src/Data.Tuple.html#snd"><span class="hs-identifier hs-var">snd</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">([(GlobalRdrElt, Fixity)] -&gt; [[(GlobalRdrElt, Fixity)]])
-&gt; ([Fixity] -&gt; [(GlobalRdrElt, Fixity)])
-&gt; [Fixity]
-&gt; [[(GlobalRdrElt, Fixity)]]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[GlobalRdrElt] -&gt; [Fixity] -&gt; [(GlobalRdrElt, Fixity)]
forall a b. [a] -&gt; [b] -&gt; [(a, b)]
</span><a href="../../base/src/GHC.List.html#zip"><span class="hs-identifier hs-var">zip</span></a></span><span> </span><span class="annot"><span class="annottext">[GlobalRdrElt]
</span><a href="#local-6989586621681130772"><span class="hs-identifier hs-var">elts</span></a></span><span>
</span><span id="line-200"></span><span>                  </span><span class="annot"><span class="annottext">([Fixity] -&gt; [[(GlobalRdrElt, Fixity)]])
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [Fixity]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [[(GlobalRdrElt, Fixity)]]
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">(GlobalRdrElt -&gt; RnM Fixity)
-&gt; [GlobalRdrElt] -&gt; IOEnv (Env TcGblEnv TcLclEnv) [Fixity]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt -&gt; RnM Fixity
</span><a href="#local-6989586621681130766"><span class="hs-identifier hs-var">lookup_gre_fixity</span></a></span><span> </span><span class="annot"><span class="annottext">[GlobalRdrElt]
</span><a href="#local-6989586621681130772"><span class="hs-identifier hs-var">elts</span></a></span><span>
</span><span id="line-201"></span><span>
</span><span id="line-202"></span><span>      </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">[[(GlobalRdrElt, Fixity)]]
</span><a href="#local-6989586621681130770"><span class="hs-identifier hs-var">fixities</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-203"></span><span>        </span><span class="hs-comment">-- There should always be at least one fixity.</span><span>
</span><span id="line-204"></span><span>        </span><span class="hs-comment">-- Something's very wrong if there are no fixity candidates, so panic</span><span>
</span><span id="line-205"></span><span>        </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; RnM Fixity
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;get_ambiguous_fixity: no candidates for a given RdrName&quot;</span></span><span>
</span><span id="line-206"></span><span>        </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GlobalRdrElt
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681130764"><span class="annot"><span class="annottext">Fixity
</span><a href="#local-6989586621681130764"><span class="hs-identifier hs-var">fix</span></a></span></span><span class="hs-special">)</span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span class="annot"><span class="annottext">[(GlobalRdrElt, Fixity)]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Fixity -&gt; RnM Fixity
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Fixity
</span><a href="#local-6989586621681130764"><span class="hs-identifier hs-var">fix</span></a></span><span>
</span><span id="line-207"></span><span>        </span><span id="local-6989586621681130763"><span class="annot"><span class="annottext">[[(GlobalRdrElt, Fixity)]]
</span><a href="#local-6989586621681130763"><span class="hs-identifier hs-var">ambigs</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#addErr"><span class="hs-identifier hs-var">addErr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RdrName -&gt; [[(GlobalRdrElt, Fixity)]] -&gt; SDoc
forall {a} {a} {t :: * -&gt; *}.
(Outputable a, Outputable a, Foldable t) =&gt;
a -&gt; t [(GlobalRdrElt, a)] -&gt; SDoc
</span><a href="#local-6989586621681130761"><span class="hs-identifier hs-var">ambiguous_fixity_err</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681130775"><span class="hs-identifier hs-var">rdr_name</span></a></span><span> </span><span class="annot"><span class="annottext">[[(GlobalRdrElt, Fixity)]]
</span><a href="#local-6989586621681130763"><span class="hs-identifier hs-var">ambigs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-208"></span><span>                  </span><span class="annot"><span class="annottext">TcRn () -&gt; RnM Fixity -&gt; RnM Fixity
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; m b -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E"><span class="hs-operator hs-var">&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Fixity -&gt; RnM Fixity
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SourceText -&gt; Int -&gt; FixityDirection -&gt; Fixity
</span><a href="GHC.Types.Basic.html#Fixity"><span class="hs-identifier hs-var">Fixity</span></a></span><span> </span><span class="annot"><span class="annottext">SourceText
</span><a href="GHC.Types.Basic.html#NoSourceText"><span class="hs-identifier hs-var">NoSourceText</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="GHC.Types.Basic.html#minPrecedence"><span class="hs-identifier hs-var">minPrecedence</span></a></span><span> </span><span class="annot"><span class="annottext">FixityDirection
</span><a href="GHC.Types.Basic.html#InfixL"><span class="hs-identifier hs-var">InfixL</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-209"></span><span>
</span><span id="line-210"></span><span>    </span><span id="local-6989586621681130766"><span class="annot"><span class="annottext">lookup_gre_fixity :: GlobalRdrElt -&gt; RnM Fixity
</span><a href="#local-6989586621681130766"><span class="hs-identifier hs-var hs-var">lookup_gre_fixity</span></a></span></span><span> </span><span id="local-6989586621681130760"><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681130760"><span class="hs-identifier hs-var">gre</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; OccName -&gt; RnM Fixity
</span><a href="GHC.Rename.Fixity.html#lookupFixityRn%27"><span class="hs-identifier hs-var">lookupFixityRn'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GlobalRdrElt -&gt; Name
</span><a href="GHC.Types.Name.Reader.html#gre_name"><span class="hs-identifier hs-var hs-var">gre_name</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681130760"><span class="hs-identifier hs-var">gre</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GlobalRdrElt -&gt; OccName
</span><a href="GHC.Types.Name.Reader.html#greOccName"><span class="hs-identifier hs-var">greOccName</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681130760"><span class="hs-identifier hs-var">gre</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-211"></span><span>
</span><span id="line-212"></span><span>    </span><span id="local-6989586621681130761"><span class="annot"><span class="annottext">ambiguous_fixity_err :: a -&gt; t [(GlobalRdrElt, a)] -&gt; SDoc
</span><a href="#local-6989586621681130761"><span class="hs-identifier hs-var hs-var">ambiguous_fixity_err</span></a></span></span><span> </span><span id="local-6989586621681130751"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681130751"><span class="hs-identifier hs-var">rn</span></a></span></span><span> </span><span id="local-6989586621681130750"><span class="annot"><span class="annottext">t [(GlobalRdrElt, a)]
</span><a href="#local-6989586621681130750"><span class="hs-identifier hs-var">ambigs</span></a></span></span><span>
</span><span id="line-213"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Ambiguous fixity for record field&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681130751"><span class="hs-identifier hs-var">rn</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-214"></span><span>             </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; Int -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Conflicts: &quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="annot"><span class="annottext">(SDoc -&gt; SDoc)
-&gt; ([(GlobalRdrElt, a)] -&gt; SDoc) -&gt; [(GlobalRdrElt, a)] -&gt; SDoc
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="annot"><span class="annottext">([SDoc] -&gt; SDoc)
-&gt; ([(GlobalRdrElt, a)] -&gt; [SDoc]) -&gt; [(GlobalRdrElt, a)] -&gt; SDoc
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span>
</span><span id="line-215"></span><span>               </span><span class="annot"><span class="annottext">((GlobalRdrElt, a) -&gt; SDoc) -&gt; [(GlobalRdrElt, a)] -&gt; [SDoc]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">(GlobalRdrElt, a) -&gt; SDoc
forall {a}. Outputable a =&gt; (GlobalRdrElt, a) -&gt; SDoc
</span><a href="#local-6989586621681130747"><span class="hs-identifier hs-var">format_ambig</span></a></span><span> </span><span class="annot"><span class="annottext">([(GlobalRdrElt, a)] -&gt; SDoc) -&gt; [(GlobalRdrElt, a)] -&gt; SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">t [(GlobalRdrElt, a)] -&gt; [(GlobalRdrElt, a)]
forall (t :: * -&gt; *) a. Foldable t =&gt; t [a] -&gt; [a]
</span><a href="../../base/src/Data.Foldable.html#concat"><span class="hs-identifier hs-var">concat</span></a></span><span> </span><span class="annot"><span class="annottext">t [(GlobalRdrElt, a)]
</span><a href="#local-6989586621681130750"><span class="hs-identifier hs-var">ambigs</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-216"></span><span>
</span><span id="line-217"></span><span>    </span><span id="local-6989586621681130747"><span class="annot"><span class="annottext">format_ambig :: (GlobalRdrElt, a) -&gt; SDoc
</span><a href="#local-6989586621681130747"><span class="hs-identifier hs-var hs-var">format_ambig</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681130743"><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681130743"><span class="hs-identifier hs-var">elt</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681130742"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681130742"><span class="hs-identifier hs-var">fix</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; Int -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681130742"><span class="hs-identifier hs-var">fix</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-218"></span><span>                                 </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GlobalRdrElt -&gt; SDoc
</span><a href="GHC.Types.Name.Reader.html#pprNameProvenance"><span class="hs-identifier hs-var">pprNameProvenance</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681130743"><span class="hs-identifier hs-var">elt</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-219"></span></pre></body></html>